﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="MvcMembership.Controllers" %>
<asp:Content ID="content" ContentPlaceHolderID="MainContent" runat="server">

<h2 class="MvcMembership">Users In "<% =( ViewData["Role"] as MembershipRoleViewData ).Name %>" Role</h2>
<h3 class="MvcMembership"><% =Html.ActionLink<MembershipAdministrationController>( x => x.Index( null, null ), "<< Return to Membership Administration" )%></h3>

<fieldset class="MvcMembership">
	<legend>Users In "<% =( ViewData["Role"] as MembershipRoleViewData ).Name %>" Role</legend>

	<% if( ( ViewData["Role"] as MembershipRoleViewData ).Users.Count > 0 ){ %>
	<ol>
		<% foreach( MembershipUser user in ( ViewData["Role"] as MembershipRoleViewData ).Users ){ %>
		<li><% =Html.ActionLink<MembershipAdministrationController>( x => x.UserDetails( (Guid)user.ProviderUserKey ), user.UserName )%> (<% =Html.ActionLink<MembershipAdministrationController>( x => x.RemoveUserFromRole( (Guid)user.ProviderUserKey, ( ViewData["Role"] as MembershipRoleViewData ).Name ), "Remove" )%>)</li>
		<% } %>
	</ol>
	<% }else{ %>
	<div>No users have been added to this role yet.</div>
	<% } %>
</fieldset>

</asp:Content>